package com.ruoyi.weiriya.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ruoyi.weiriya.domain.WLeaveWord;
import com.ruoyi.weiriya.domain.WNonVipSetting;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用户反馈管理Mapper接口
 * 
 * @author lynn
 * @date 2023-08-01
 */
public interface WLeaveWordMapper extends BaseMapper<WLeaveWord>
{
    @Select("SELECT lw.*,m.user_name as member_user_name,m.nick_name as member_nick_name,su.nick_name as reply_user_nick_name FROM w_leave_word lw " +
            "LEFT JOIN w_member m on m.id = lw.member_id " +
            "LEFT JOIN sys_user su on lw.reply_user_id = su.user_id ${ew.customSqlSegment}")
    List<WLeaveWord> getList(@Param(Constants.WRAPPER) QueryWrapper<WLeaveWord> queryWrapper);


    @Select("SELECT lw.*,m.user_name as member_user_name,m.nick_name as member_nick_name,su.nick_name as reply_user_nick_name FROM w_leave_word lw " +
            "LEFT JOIN w_member m on m.id = lw.member_id " +
            "LEFT JOIN sys_user su on lw.reply_user_id = su.user_id " +
            "WHERE lw.id = #{id}")
    WLeaveWord getWLeaveWordById(String id);
}
